let mongoose = require('mongoose')
let Schema = mongoose.Schema 

let userSchema = new Schema({
  userId: String,
  userName: String,
  userPwm: String,
  orderList:Array, //订单列表
  cartList:[ // 购物车
    {
      'productId': String,
      'productName': String,
      'salePrice': String,
      'productImage': String,
      'productNum': String,
      'checked': String
    }
  ],
  //地址
  addressList:[
    {
      "addressId" : String,
      "userName" : String,
      "streetName" : String,
      "postCode" : String,
      "tel" : String,
      "isDefault" : Boolean
    }
  ] 
})

module.exports = mongoose.model('User',userSchema)